<?php
namespace console\spider;


class ZzglSpider {

    public function  start()
    {
        echo "zzgl spider start .......\n";

        //登录
        $ret = ZzglLogin::ZzxsLogin();
        if($ret > -1) {
        SchoolSpider::getSchools();

        $dir = Params::schoolDir;
        $files = FileUtils::findFileName($dir);
        foreach ($files as  $fileName) {
            $schoolList = json_decode(file_get_contents($dir.$fileName));
            foreach ($schoolList->resultList as $school){
//            学校信息
                SchoolSpider::getSchoolInfo($school);
//            招生计划审核
                ZSGLSpider::getEnrollmentPlanInfo($school->entity->zzXxJbxx);
//            通过学校iD爬取审核的专业
                MajorSpider::getSHMajor($school->entity->zzXxJbxx);

            }
        }

          MajorSpider::getMajor();
          MajorSpider::analysisMajorData('tz');
          MajorSpider::analysisMajorData('zc');


        StudentSpider::getStudents();
        StudentSpider::analysisStudentsData();
        //招生计划审核
        ZSGLSpider::getEnrollmentPlan();
        }
    }
}



